//
//  TMGHotActivtyViewController.m
//  TMGold
//
//  Created by Mac on 2017/12/13.
//  Copyright © 2017年 tangmu. All rights reserved.
//

#import "TMGHotActivtyViewController.h"

@interface TMGHotActivtyViewController ()

@end

@implementation TMGHotActivtyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"热门活动";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 100)];
    header.backgroundColor = [UIColor whiteColor];
    
//    UIImageView * bannerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 204)];
//    bannerImageView.image = [UIImage imageNamed:@"banner01"];
//    bannerImageView.userInteractionEnabled = YES;
//    [header addSubview:bannerImageView];
    __weak typeof(self) weakSelf =  self;
    STButton * buyButton = [[STButton alloc] initWithFrame:CGRectMake(0, 20, UIScreenWidth, 153)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:0
                                           backgroundColor:nil
                                           backgroundImage:[UIImage imageNamed:@"banner01"]
                                                     image:nil];
    [buyButton setClicAction:^(UIButton *sender) {
        [weakSelf onSelctedGreenHandleAction];
    }];
    [header addSubview:buyButton];
    header.height = buyButton.bottom;
    self.tableView.tableHeaderView = header;
    

}
#pragma mark --Action Method
- (void)onSelctedGreenHandleAction{
    TMGGreenHandViewController * vc = [TMGGreenHandViewController new];
    TMHomeCellModel * model = [TMHomeCellModel new];
    model.name = @"新手特权金";
    model.productID = @(1);
    model.type = @(1);
    vc.model = model;
    [self.navigationController pushViewController:vc animated:YES];
}
@end
